<template>
  <div>
    <BorrowAdminList v-slot="info">
      <input type="button" @click="isdel(info.id)" value="删除" class="btn btn-primary">
    </BorrowAdminList>
  </div>
</template>
<script>
import axios from 'axios'
import BorrowAdminList from './BorrowAdminList.vue'

const isdel=(B_id:any)=>{
  if(confirm('确定要删除吗？')){
    axios({
      url:'http://localhost:54566/api/Borrow/GetDelete',
      method:'get',
      params:{
        B_id:B_id
      }
    })
    .then((res)=>{
      console.log(res.data)
      if(res.data>0){
        alert('删除成功')
        show()
      }
      else{
        alert('删除失败')
      }
    })
    .catch((err)=>{
      console.log(err)
    })
  }
}

</script>